/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package keyboardhostapp;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.*;

/**
 *
 * @author data
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            Socket s = new Socket("10.1.92.2",1920);
            System.out.println("connected");
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
            BufferedReader back = new BufferedReader(new InputStreamReader(s.getInputStream()));
            while(true) {
                String line = br.readLine();
                bw.write(line+"\n");
                bw.flush();
                String b = back.readLine();
                System.out.println(b.replace('!', '\n'));
            }
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

}
